package com.example.dllo.keepdemo.dynamic;

import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import java.util.ArrayList;

/**
 * Created by dllo on 16/1/8.
 */
public class DynamicViewPagerAdapter extends FragmentPagerAdapter {
    private Context context;
    private ArrayList<Fragment> data;
    private String[] titles = {"发现","关注","最新"};

    public DynamicViewPagerAdapter(FragmentManager fm,ArrayList<Fragment> data,Context context) {
        super(fm);
        this.data = data;
        this.context = context;
    }

    @Override
    public Fragment getItem(int position) {
        return data.get(position);
    }

    @Override
    public int getCount() {
        return data.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return titles[position];
    }
}
